import { request } from '@/utils/request.js'

/**
 * 托盘 API JS
 */

export default {
  /**
   * 获取列表
   * @returns
   */
  getList (params = {}) {
    return request({
      url: 'sea/waybillCar/index',
      method: 'get',
      params
    })
  },
   /**
   * 列表list
   * @returns
   */
   getListCar (params = {}) {
    return request({
      url: 'sea/waybillCar/list',
      method: 'get',
      params
    })
  },
  //托盘接收
  recived (data = {}) {
    return request({
      url: 'sea/waybillCar/recived',
      method: 'put',
      data
    })
  },

  /**
   * 添加
   * @returns
   */
  save (data = {}) {
    return request({
      url: 'sea/waybillCar/save',
      method: 'post',
      data
    })
  },

  /**
   * 更新数据
   * @returns
   */
  update (data = {}) {
    return request({
      url: 'sea/waybillCar/update/' + data.id,
      method: 'put',
      data
    })
  },
   /**
   * 读取转运单
   * @returns
   */
   read (id) {
    return request({
      url: 'sea/waybillCar/read/' + id,
      method: 'get',
    })
  },
   /**
   * 删除，有软删除则移动到回收站
   * @returns
   */
   deletes (data) {
    return request({
      url: 'sea/waybillCar/delete',
      method: 'delete',
      data
    })
  },
 
   /**
   * 出车
   * @returns
   */
   sendCar (data = {}) {
    return request({
      url: 'sea/waybillCar/send',
      method: 'post',
      data
    })
  },

      /**
   * 约车
   * @returns
   */
  reserveCar (data = {}) {
    return request({
      url: 'sea/waybillCar/reserve',
      method: 'post',
      data
    })
  },
    /**
   * 送达
   * @returns
   */
    closeCar (data = {}) {
      return request({
        url: 'sea/waybillCar/close',
        method: 'post',
        data
      })
    },
  /**
   * 解除车辆绑定
   * @returns
   */
  outCar (data = {}) {
    return request({
      url: 'sea/waybillTaskSend/outCar',
      method: 'post',
      data
    })
  },
      /**
   * 运单库存列表
   * @returns
   */
  waybillListCar (params = {}) {
    return request({
      url: 'sea/waybillTrayList/index',
      method: 'get',
      params
    })
  },
      /**
   * 托盘列表
   * @returns
   */
      waybillTrayListCar (params = {}) {
        return request({
          url: 'sea/waybillTrayList/index',
          method: 'get',
          params
        })
      },
}